package io.github.yedaxia.apidocs;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

/**
 * @author yeguozhong yedaxia.github.com
 */
@Data
public class DocsConfig {
    List<String> javaSrcPaths = new ArrayList<>(); //multi modules support
    String docsPath; // default equals projectPath
    String resourcePath; // if empty, use the default resources
    String mvcFramework; //spring, play, jfinal, generic, can be empty
    String apiVersion; // this api version
    String projectName; //project name
    Boolean autoGenerate = Boolean.FALSE; // 自动生成所有Controller的接口文档，不需要@ApiDoc注解
    Locale locale = Locale.getDefault();
    Boolean openReflection = Boolean.TRUE; // 是否开启对象反射

    String rapHost;
    String rapLoginCookie;
    String rapProjectId;
    String rapAccount;
    String rapPassword;

    List<IPluginSupport> plugins = new ArrayList<>();

    List<IPluginSupport> getPlugins() {
        return plugins;
    }

    /**
     * add your own plugin, example:
     *
     * @param plugin
     * @see io.github.yedaxia.apidocs.plugin.rap.RapSupportPlugin
     */
    public void addPlugin(IPluginSupport plugin) {
        this.plugins.add(plugin);
    }

    /**
     * if cannot find the java file from other module, you can try to config the java src path yourself.
     *
     * @param javaSrcPath
     */
    public void addJavaSrcPath(String javaSrcPath) {
        javaSrcPaths.add(javaSrcPath);
    }

    public void addJavaSrcPaths(List<String> javaSrcPaths) {
        this.javaSrcPaths.addAll(javaSrcPaths);
    }

}
